<?php

namespace app\common\model\search;

trait PropagandaEducationHistorySearch
{
    //宣教分类
    public function searchClassIdAttr($query, $value, $data)
    {
        return $query->where('class_id', $value);
    }

    //宣教名称
    public function searchEdNameAttr($query, $value, $data)
    {
        return $query->where('ed_name', 'like', $value);
    }

    //发送者
    public function searchCreatorNameAttr($query, $value, $data)
    {
        return $query->where('creator_name', 'like', $value);
    }

    //接收人
    public function searchNameAttr($query, $value, $data)
    {
        return $query->where('name', 'like', $value);
    }

    //发送时间
    public function searchPushtimeAttr($query, $value, $data)
    {
        return $query->where('pushtime_ymd', $value);
    }

    //宣教范围
    public function searchTypeAttr($query, $value, $data)
    {
        return $query->where('type', (int)$value);
    }

    //宣教范围
    public function searchIsviewAttr($query, $value, $data)
    {
        return $query->where('isview', (int)$value);
    }

    //发送状态
    public function searchStatusAttr($query, $value, $data)
    {
        return $query->where('status', (int)$value);
    }
}